package com.example.MatchGame;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.wonderfulradish.ActivityCollector;
import com.example.wonderfulradish.Choose_Game;
import com.example.wonderfulradish.R;

public class MatchSelecte extends AppCompatActivity implements View.OnClickListener{
    private Button matchselectback;
    private Button startMatch;
    private  int flag=1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_match_selecte);
        matchselectback=(Button) findViewById(R.id.matchselectback);
        matchselectback.setOnClickListener(this);
        startMatch=(Button) findViewById(R.id.start_match);
        startMatch.setOnClickListener(this);

    }
    public void onClick(View v){
        switch (v.getId()){
            case R.id.start_match:
                flag=0;
                if (flag==0)
                startMatch.setBackgroundResource(R.drawable.guanqia_btn1_png);
                Intent intent=new Intent(MatchSelecte.this,StartMatchActivity.class);
                startActivity(intent);
                break;
            case R.id.matchselectback:
                Intent intent1=new Intent(MatchSelecte.this,Choose_Game.class);
                startActivity(intent1);
                break;
            default:
                break;
        }

    }

        @Override
        protected void onDestroy(){
            super.onDestroy();
            ActivityCollector.removeActivity(this);
        }
}

